package com.foreveross.fetl.core.domain.task;

import java.util.List;

import javax.persistence.Column;
import javax.persistence.Id;
import javax.persistence.Table;

import com.dayatang.domain.Entity;
import com.dayatang.domain.InstanceFactory;
import com.foreveross.fetl.common.domain.BaseEntity;
import com.foreveross.fetl.core.domain.task.repository.FlightInfoEntityRepository;

@javax.persistence.Entity
@Table(name = "FDC_FLIGHTINFO")
@SuppressWarnings("serial")
public class FlightInfoEntity extends BaseEntity {

	@Id
	@Column(name = "ID")
	private String id;

	@Column(name = "FROMCITY")
	private String fromCity;
	@Column(name = "FROMCITYNAME")
	private String fromCityName;
	@Column(name = "TOCITY")
	private String toCity;
	@Column(name = "TOCITYNAME")
	private String toCityName;

	@Column(name = "FLIGHTNO")
	private String flightNo;

	@Column(name = "AREA_NAME")
	private String areaName;
	@Column(name = "AREA_CODE")
	private String areaCode;

	@Column(name = "COMPANY_CODE")
	private String companyCode;
	@Column(name = "COMPANY_NAME")
	private String companyName;

	@Column(name = "FLIGHT_START_TIME")
	private String startTime;
	
	@Column(name = "FLIGHT_END_TIME")
	private String endTime;
	
	@Column(name = "GRAB_CHANNEL_NUM")
	private String grabChannel;

	public String getStartTime() {
		return startTime;
	}

	public String getGrabChannel() {
		return grabChannel;
	}

	public void setGrabChannel(String grabChannel) {
		this.grabChannel = grabChannel;
	}

	public void setStartTime(String startTime) {
		this.startTime = startTime;
	}

	public String getEndTime() {
		return endTime;
	}

	public void setEndTime(String endTime) {
		this.endTime = endTime;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getAreaName() {
		return areaName;
	}

	public String getCompanyCode() {
		return companyCode;
	}

	public void setCompanyCode(String companyCode) {
		this.companyCode = companyCode;
	}

	public String getCompanyName() {
		return companyName;
	}

	public void setCompanyName(String companyName) {
		this.companyName = companyName;
	}

	public void setAreaName(String areaName) {
		this.areaName = areaName;
	}

	public String getAreaCode() {
		return areaCode;
	}

	public void setAreaCode(String areaCode) {
		this.areaCode = areaCode;
	}

	public String getFromCity() {
		return fromCity;
	}

	public void setFromCity(String fromCity) {
		this.fromCity = fromCity;
	}

	public String getToCity() {
		return toCity;
	}

	public void setToCity(String toCity) {
		this.toCity = toCity;
	}

	public String getFromCityName() {
		return fromCityName;
	}

	public void setFromCityName(String fromCityName) {
		this.fromCityName = fromCityName;
	}

	public String getToCityName() {
		return toCityName;
	}

	public void setToCityName(String toCityName) {
		this.toCityName = toCityName;
	}

	public String getFlightNo() {
		return flightNo;
	}

	public void setFlightNo(String flightNo) {
		this.flightNo = flightNo;
	}
	@Override
	public FlightInfoEntityRepository getBaseEntityRepository() {
		return InstanceFactory.getInstance(FlightInfoEntityRepository.class);
	}
	public List<FlightInfoEntity> findByLine(String fromCityCode,
			String toCityCode) {
		return getBaseEntityRepository().findByLine(fromCityCode, toCityCode);
	}

	public List<FlightInfoEntity> findFlightInfoEntitys(String companyCode,
			String fromCityCode, String toCityCode) {
		return getBaseEntityRepository().findFlightInfoEntitys(companyCode,
				fromCityCode, toCityCode);
	}

	public List<FlightInfoEntity> findAll() {
		return getBaseEntityRepository().findAll(FlightInfoEntity.class);
	}
	
	public List<FlightInfoEntity> findDistinctFlightInfoEntitys(String companyCode,
			String fromCityCode, String toCityCode) {
		return getBaseEntityRepository().findDistinctFlightInfoEntitys(companyCode, fromCityCode, toCityCode);
	}
	public List<FlightInfoEntity> findFlightInfoEntitys(String companyCode) {
		return getBaseEntityRepository().findFlightInfoEntitys(companyCode);
	}

}
